<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico">
  <link rel="mask-icon" href="/images/favicon.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"blog.upup.fun","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="以前对于webpack的配置一直感觉云里雾里，包括实习的时候对webpack的配置也是摸不清楚，所以学习一下webpack，并记录一下学习过程中遇到的问题。">
<meta property="og:type" content="article">
<meta property="og:title" content="webpack学习 —— entry">
<meta property="og:url" content="http://blog.upup.fun/2021/01/31/webpack%E5%AD%A6%E4%B9%A0%E2%80%94%E2%80%94entry/index.html">
<meta property="og:site_name" content="猫头猫">
<meta property="og:description" content="以前对于webpack的配置一直感觉云里雾里，包括实习的时候对webpack的配置也是摸不清楚，所以学习一下webpack，并记录一下学习过程中遇到的问题。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-01-31T12:44:28.000Z">
<meta property="article:modified_time" content="2021-02-27T17:21:58.892Z">
<meta property="article:author" content="猫头猫">
<meta property="article:tag" content="webpack">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://blog.upup.fun/2021/01/31/webpack%E5%AD%A6%E4%B9%A0%E2%80%94%E2%80%94entry/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>webpack学习 —— entry | 猫头猫</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">猫头猫</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-works">

    <a href="/works/" rel="section"><i class="fa fa-smile fa-fw"></i>小作品</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://blog.upup.fun/2021/01/31/webpack%E5%AD%A6%E4%B9%A0%E2%80%94%E2%80%94entry/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="猫头猫">
      <meta itemprop="description" content="如果我是一只小猫咪，每天只要喵喵叫。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="猫头猫">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          webpack学习 —— entry
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-01-31 20:44:28" itemprop="dateCreated datePublished" datetime="2021-01-31T20:44:28+08:00">2021-01-31</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%89%8D%E7%AB%AF/" itemprop="url" rel="index"><span itemprop="name">前端</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%89%8D%E7%AB%AF/webpack/" itemprop="url" rel="index"><span itemprop="name">webpack</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2.8k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>
            <div class="post-description">以前对于webpack的配置一直感觉云里雾里，包括实习的时候对webpack的配置也是摸不清楚，所以学习一下webpack，并记录一下学习过程中遇到的问题。</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="基本思想"><a href="#基本思想" class="headerlink" title="基本思想"></a>基本思想</h2><p>在开始之前，首先想一下，如果不用各种框架，我们会怎么去开发一个web前端页面。页面的骨架由html组成，html内可能以内嵌或者引入外部文件的方式来加载css和js。为了使得代码不至于太臃肿，我们会倾向于选择引入外部文件。对于想尽快完成任务的人来说，都会优先选择一些别人开发好的外部js库来提升效率，比如说在我们自己的js代码<strong>之前</strong>使用script标签引入jquery库，由于jquery在window对象下挂载了一个名为$的变量，并且它在页面加载时优先于我们自定义的代码被执行，因此我们可以在我们的代码中尽情使用jquery。那么问题来了：当规模比较庞大，需要引入很多很多外部的库的时候，或者我们的代码量很大，需要由不同的人写一些重复功能的代码的时候，代码整体的组织势必会混乱，单人开发可能都会难以管理，何况多人协同。同时，我们也不能保证我们引入的库是否挂载在同名变量下，也就是可能会有命名空间的冲突。</p>
<p>这个时候，我们想一下我们以前学过的其他语言是怎么做的：比如说我们需要使用python实现某个功能，我们可能会把部分工具代码作为一个模块，写在一个文件中，在其他需要使用到地方进行导入。这种方式有显而易见的好处：最直接的是，命名空间不会被污染（因为并没有挂载到相同的全局变量下），除此之外，模块之间耦合程度低，增加了代码的可维护性。不过，在以前(ES6之前)，这种方式在浏览器中对于js来说是行不通的。</p>
<p>这个时候，webpack就体现出了它的作用。webpack认为，工程中的每一个文件都可以看作一个模块，我们可以在代码中以commonjs的标准定义js模块，当我们在配置中指定某一个js文件作为根入口(entry)时，webpack可以根据我们导入的其他模块来自动的递归的生成依赖树，把所有涉及到的js文件按顺序打包到一个或多个js文件中，并插入到html文档中。webpack默认是只对js文件进行操作，但是，我们也可以通过使用loader对其他的非js的文件进行加载。</p>
<p>那么接下来，我们从最开始的入口——entry开始吧。</p>
<h2 id="entry的定义"><a href="#entry的定义" class="headerlink" title="entry的定义"></a>entry的定义</h2><blockquote>
<p>entry是配置模块的入口，可抽象成输入，Webpack 执行构建的第一步将从入口开始搜寻及递归解析出所有入口依赖的模块。(参考：<a target="_blank" rel="noopener" href="https://webpack.wuhaolin.cn/2%E9%85%8D%E7%BD%AE/2-1Entry.html">https://webpack.wuhaolin.cn/2%E9%85%8D%E7%BD%AE/2-1Entry.html</a>)</p>
</blockquote>
<p>在webpack.config.js中我们可以这样去定义：<br><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">    <span class="attr">entry</span>: <span class="string">&#x27;xxx&#x27;</span> </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>其中，entry的值有三种：</p>
<ul>
<li>字符串：string<br>  这种类型指定了一个入口，于是webpack会以这个文件作为入口，输出一个打包后的bundle.js（不一定叫这个名字）</li>
<li>字符串数组：string[]<br>  这种类型指定了多个入口，webpack会依次以这些入口递归的分析并打包，输出一个打包后的bundle.js。</li>
<li>对象：object<string, string|string[]><br>  这种类型指定了多个入口，webpack会把这些值作为入口依次进行递归的分析并打包，输出<strong>多个</strong>打包后的文件，每个文件默认的名字是对象中的key的名字。</li>
</ul>
<p>看上去都是很好理解的概念，但是接下来问题就来了：</p>
<h2 id="入口的文件存在引用怎么处理"><a href="#入口的文件存在引用怎么处理" class="headerlink" title="入口的文件存在引用怎么处理?"></a>入口的文件存在引用怎么处理?</h2><p>假如有两个文件：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/***** src/a.js *****/</span></span><br><span class="line"><span class="keyword">import</span> <span class="string">&#x27;./b.js&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load a&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">/***** src/b.js *****/</span></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load b&#x27;</span>)</span><br></pre></td></tr></table></figure></p>
<h3 id="array类型"><a href="#array类型" class="headerlink" title="array类型"></a>array类型</h3><p>假如根目录下的webpack.config.js的入口指定为：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">    <span class="attr">entry</span>: [</span><br><span class="line">        <span class="string">&#x27;./src/a.js&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;./src/b.js&#x27;</span></span><br><span class="line">    ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>我们可以看到，首先，webpack会以a为入口，a引入了b，所以先加载b，然后加载a，因此输出load b，load a。然后以b为入口，由于这种模式下会打包到同一个文件中，而这个文件已经引入了b，所以此时不会再引入b，因此最终的输出就是：load b和load a。</p>
<h3 id="object类型："><a href="#object类型：" class="headerlink" title="object类型："></a>object类型：</h3><p>假如根目录下的webpack.config.js的入口指定为：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">    <span class="attr">entry</span>: [</span><br><span class="line">        e1: <span class="string">&#x27;./src/a.js&#x27;</span>,</span><br><span class="line">        <span class="attr">e2</span>: <span class="string">&#x27;./src/b.js&#x27;</span></span><br><span class="line">    ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>这种情况下，我们知道，默认会被打包成2个文件，一个名为e1，一个名为e2。首先以e1为入口，分析发现，引入了b的代码，因此输出load b。然后输出load a。此时e1打包完成。但是与array不一样的是，object类型的每一个键值对都会被打包成一个js文件，在这种情况下，还是会以b为入口，再次去进行递归检索。此时又会输出load b。因此最终的输出是 load b， load a和load b。</p>
<h2 id="循环引用怎么处理？"><a href="#循环引用怎么处理？" class="headerlink" title="循环引用怎么处理？"></a>循环引用怎么处理？</h2><p>假如有两个文件：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/***** src/a.js *****/</span></span><br><span class="line"><span class="keyword">import</span> <span class="string">&#x27;./b.js&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load a&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">/***** src/b.js *****/</span></span><br><span class="line"><span class="keyword">import</span> <span class="string">&#x27;./a.js&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load b&#x27;</span>)</span><br></pre></td></tr></table></figure></p>
<p>假如根目录下的webpack.config.js的入口指定为：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">    <span class="attr">entry</span>: [</span><br><span class="line">        e1: <span class="string">&#x27;./src/a.js&#x27;</span>,</span><br><span class="line">        <span class="attr">e2</span>: <span class="string">&#x27;./src/b.js&#x27;</span></span><br><span class="line">    ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><br>经过测试，这种情况下webpack会采用一个类似于标记是否访问过的策略。首先以a为入口，a导入了b，那么先输出load b，然后发现b导入了a，这个时候认为a已经导入过了，便输出一个load a，就结束了。object同理。</p>
<p>当然，这种情况下，如果使用到了另一个模块中未定义的变量，最终打包后的文件就会出现未初始化的错误。并且还存在于类似于懒加载的机制：假如引入了另一个文件，但是并没有使用其中的变量，那么它也不会报错，比如：<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/***** src/a.js *****/</span></span><br><span class="line"><span class="keyword">import</span> b <span class="keyword">from</span> <span class="string">&#x27;./b.js&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load a&#x27;</span>, b);</span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> <span class="string">&#x27;a&#x27;</span>;</span><br><span class="line"><span class="comment">/***** src/b.js *****/</span></span><br><span class="line"><span class="keyword">import</span> a <span class="keyword">from</span> <span class="string">&#x27;./a.js&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">console</span>.log(<span class="string">&#x27;load b&#x27;</span>) ; <span class="comment">// 如果按照上边entry的写法，写console.log(a)就会报错</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> <span class="string">&#x27;b&#x27;</span>;</span><br></pre></td></tr></table></figure></p>

    </div>

    
    
    
        <div class="reward-container">
  <div>嘻嘻</div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.png" alt="猫头猫 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.png" alt="猫头猫 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/images/wechat_channel.jpg">
            <span class="icon">
              <i class="fab fa-weixin"></i>
            </span>

            <span class="label">WeChat</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/webpack/" rel="tag"><i class="fa fa-tag"></i> webpack</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/10/18/%E9%98%B4%E9%98%B3%E5%B8%88%E5%A6%96%E6%80%AA%E5%B1%8B-%E4%BD%A0%E7%9A%84%E5%BC%8F%E7%A5%9E%E6%98%AF%E6%80%8E%E4%B9%88%E8%A2%AB%E5%89%AA%E5%87%BA%E6%9D%A5%E7%9A%84/" rel="prev" title="【阴阳师妖怪屋】你的式神是怎么被剪出来的？">
      <i class="fa fa-chevron-left"></i> 【阴阳师妖怪屋】你的式神是怎么被剪出来的？
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/02/27/%E4%BD%BF%E7%94%A8electron%E5%BC%80%E5%8F%91%E8%84%9A%E6%9C%AC%E7%AE%A1%E7%90%86%E5%99%A8/" rel="next" title="使用electron开发脚本管理器">
      使用electron开发脚本管理器 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
      <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=477844082&auto=1&height=66"></iframe>

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9F%BA%E6%9C%AC%E6%80%9D%E6%83%B3"><span class="nav-number">1.</span> <span class="nav-text">基本思想</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#entry%E7%9A%84%E5%AE%9A%E4%B9%89"><span class="nav-number">2.</span> <span class="nav-text">entry的定义</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%A5%E5%8F%A3%E7%9A%84%E6%96%87%E4%BB%B6%E5%AD%98%E5%9C%A8%E5%BC%95%E7%94%A8%E6%80%8E%E4%B9%88%E5%A4%84%E7%90%86"><span class="nav-number">3.</span> <span class="nav-text">入口的文件存在引用怎么处理?</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#array%E7%B1%BB%E5%9E%8B"><span class="nav-number">3.1.</span> <span class="nav-text">array类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#object%E7%B1%BB%E5%9E%8B%EF%BC%9A"><span class="nav-number">3.2.</span> <span class="nav-text">object类型：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%BE%AA%E7%8E%AF%E5%BC%95%E7%94%A8%E6%80%8E%E4%B9%88%E5%A4%84%E7%90%86%EF%BC%9F"><span class="nav-number">4.</span> <span class="nav-text">循环引用怎么处理？</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="猫头猫"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">猫头猫</p>
  <div class="site-description" itemprop="description">如果我是一只小猫咪，每天只要喵喵叫。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">31</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/maotoumao" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;maotoumao" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:lhx_xjtu@163.com" title="E-Mail → mailto:lhx_xjtu@163.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">猫头猫</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">91k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">1:22</span>
   | <a href="http://beian.miit.gov.cn/" rel="noopener" target="_blank">陕ICP备20005224号-2 </a>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

  

</body>
</html>
